import java.util.Scanner;

public class Sixth {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("输入长字符串：");
        String str=scan.nextLine();
        System.out.println("输入短字符串：");
        String regex=scan.nextLine();
        boolean concat = str.contains(regex);
        if(!concat){
            System.out.println("不存在");
            return;
        }
        while(true){
            str = str.replace(regex, "");
            concat = str.contains(regex);
            if(!concat){
                break;
            }
        }
        System.out.println(str);
    }
}
